
<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>修改设备类型</title>
    <link rel="shortcut icon" href="favicon.ico"> 
    <link href="${WEB_PATH}/resources/css/bootstrap.min.css?v=3.3.5" rel="stylesheet">
    <link href="${WEB_PATH}/resources/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="${WEB_PATH}/resources/css/plugins/chosen/chosen.css" rel="stylesheet">
    <link href="${WEB_PATH}/resources/css/style.min.css?v=5.0.0" rel="stylesheet"><base target="_blank">
	<link href="${WEB_PATH}/resources/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
	<link href="${WEB_PATH}/resources/css/plugins/treeview/bootstrap-treeview.css" rel="stylesheet">
    <link href="${WEB_PATH}/resources/css/plugins/jsTree/style.min.css" rel="stylesheet">
	<link href="${WEB_PATH}/resources/css/plugins/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css" rel="stylesheet">
	
</head>

<body>
	<div class="col-sm-12">
		<form class="m-t" id="addUserInfo">
		    <input  name="ID"   value="${equipmentType.ID}"  type="hidden">
            <div class="form-group">
                <label>类型名称：</label>
                <input id="NAME" name="NAME" class="form-control"  required="" value="${equipmentType.NAME}" aria-required="true"  placeholder="请输入类型名称">
            </div> 
        </form> 
	</div>
    <script src="${WEB_PATH}/resources/js/jquery.min.js?v=2.1.4"></script>
    <script src="${WEB_PATH}/resources/js/ajax.extend.js"></script>
    <script src="${WEB_PATH}/resources/js/bootstrap.min.js?v=3.3.5"></script>
	<script src="${WEB_PATH}/resources/js/plugins/datapicker/bootstrap-datepicker.js"></script>
    <script src="${WEB_PATH}/resources/js/plugins/wizard/jquery.bootstrap.wizard.js"></script>
    <script src="${WEB_PATH}/resources/js/plugins/validate/jquery.validate.min.js"></script>
    <script src="${WEB_PATH}/resources/js/plugins/validate/messages_zh.min.js"></script>
    <script src="${WEB_PATH}/resources/js/plugins/validate/jquery.validate.method.js"></script>
	<script src="${WEB_PATH}/resources/js/plugins/layer/layer.js"></script> 
	<script src="${WEB_PATH}/resources/js/plugins/jsTree/jstree.min.js"></script>
	<script src="${WEB_PATH}/resources/js/plugins/sweetalert/sweetalert.min.js"></script>
	<script src="${WEB_PATH}/resources/js/plugins/chosen/chosen.jquery.js"></script>
	<script>
	$(function(){
    });
	var e = "<i class='fa fa-times-circle'></i> ";
	$("#addUserInfo").validate({
	 	rules: {
        	CODE: {
                required: !0,
            },
            NAME: {
            	required: !0,
            }
        },
        messages: {
            CODE: {
                remote: e + "账号名称重复。"
            }
        },
        errorPlacement: function(error, element) {
        	element.before(error);
         }
   });
     //添加用户信息#commentForm
 	function saveEditForm(){
 		if($("#addUserInfo").valid()){
 			
			$.yilinAjax({
		   	  	type:'POST',
		   	  	loadmsg:'努力提交中......',
		   	  	url:'${WEB_PATH }/system/equipmenttype/edit.do',
		   	  	data:$('#addUserInfo').serialize(),
        		errorcallback:null,
        		btn:null,
        		successcallback:success
	   	    });
    	 }
 	}
 	
 	function success(result){  
 		if(result.success == true){
			 layer.alert('<font color="#1ab394">'+result.msg+'</font>', {
			  	skin: 'layui-layer-molv',
			  	icon: 1,
			  	closeBtn: 0
			},function(){
				parent.$("#exampleTableEvents").bootstrapTable('refresh');
			   	var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
			   	parent.$('#addUser').attr("disabled",false);
				parent.layer.close(index); 
				
			});
		}else{ 
	    	layer.msg(result.msg, {icon: 5}); 
		} 
    }
  </script>
</body>
</html>	